#ifndef _GOVT_TALENT_HPP_
#define	_GOVT_TALENT_HPP_
/*******************************************************************************
 ** Government Sanctioned Espionage RPG                                       **
 ** http://www.government-sanctioned.us/                                      **
 **===========================================================================**
 ** Name: talent.hpp                                                          **
 ** Description: Talents and feats for characters.                            **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012  Barry Gian James <gian@gamingods.net>            **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// Created on March 18, 2010, 1:15 PM
// Modified $Date$ by $Author$
// Portions Copyright 2012 Open Design Strategies, LLC.
// All rights reserved.
#define Talent_hpp_ID   "$Id$"

#include <string>
#include <odb/core.hxx>
#include "action.hpp"

typedef int (*talentAction)();

enum class TalentType { Combat, Item, Meta };
enum class TalentActivateType { Passive, AtWill, Number, Daily };

enum class TalentProgTags : uint8_t
{
	Core,
	A1, A2, A3, B1, B2, B3, B4, B5,
	C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15,
	D1, D2, D3, D4, D5, D6, D7,
	E1, E2, E3, E4, E5, E6, E7,
	F1, F2, F3, G1, G2, G3, H1, H2, H3, H4, H5,
	I1, I2, I3,
	Undef
};

struct TalentProgData
{
	TalentProgData() : level(0), num(0) { }
	TalentProgData(uint8_t l, uint8_t n, TalentProgTags t1, TalentProgTags t2 = TalentProgTags::Undef)
	: level(l), num(n)
	{
		talents[0] = t1; talents[1] = t2;
	}
	uint8_t		level;
	uint8_t		num;
	TalentProgTags	talents[2];
};

extern std::map<uint8_t, TalentProgData> TalentProgressionMap;

namespace talent
{
int		init();
}

//! The class that may have one of the most important roles in the game.
#pragma db object table("talent")
class Talent
{
public:
    Talent();
    Talent(const Talent& orig);
    ~Talent();

private:
    friend class odb::access;

	#pragma db id auto
    entity_t		idtalent;
    std::string    name;
    entity_t		tree;
    // The prerequisite is a JSON marshaled string
    std::string    prerequisite;
    std::string    normal;
    // The benefit is a JSON marshaled string
    std::string    benefit;
    std::string		terse;
    std::string		desc;
 //   TalentAction      action; //!< maybe a feat should just have an action.
    bool			bIsAction;	//! is this feat an action?
    TalentType		type;
    TalentActivateType	activateType;
    ActionTime		actionTime;
};

#endif	/* _TALENT_HPP_ */

